
.PHONY: all

all: build

build:
	k3s kubectl apply -f mysql.yaml
	k3s kubectl apply -f registry.yaml
	k3s kubectl apply -f phpmyadmin.yaml
	cp gogs.yaml gogs2.yaml
	sed -i "s/moonfddmyip/192.168.204.13/g" gogs2.yaml # 192.168.204.13 需要替换成宿主机IP
	k3s kubectl apply -f gogs2.yaml
	rm -rf gogs2.yaml
	k3s kubectl apply -f drone.yaml
	k3s kubectl apply -f drone-runner-ssh.yaml
	k3s kubectl apply -f drone-runner-docker.yaml
test:
	pwd

clean:
	k3s kubectl delete -f mysql.yaml
	k3s kubectl delete -f registry.yaml
	k3s kubectl delete -f phpmyadmin.yaml
	k3s kubectl delete -f gogs.yaml
	k3s kubectl delete -f drone.yaml
	k3s kubectl delete -f drone-runner-ssh.yaml
	k3s kubectl delete -f drone-runner-docker.yaml
